string "string" 'strint111' "asdfasf;lj' 'afasfas'"adfasfsa" "str" + "ing" "copy" * 3 x="a" x < "b" x < "aa" x < "A" "b" < "A" "!" < "," "ou" in "color" '''This is a very long sentence It would be unfortunate if this were all one line But it will be''' #To get new lines, we use escape characters '''This is a very long sentence\n Now we're going to get new lines\n See?''' "Don't \nneed tripe quotes to \nget new lines" "\'" "\""#Note that here python used single quotes to denote the string. "\ttest"#What if we want a backslash, "\\" # Converting ints to strings. x = "string" len(x) len("") x=10 y = "string" "string " + x "string " + 'x' "string " + str(x) #Can be a lot of work if we just want to print something y = "string " print y, x print "es\nca\t\"pe characters are formatted" #back to slides print ?My age is %d.? % age print ?Person?, name, ?has height?, \ height, ?age?, age, ?weight?, weight print ?Person %s has weight %.2f \ and age %d and height %d.? \ % (name, weight, age, height)#back to slides. name = raw_input() name age = raw_input() age age + 34 int(age) + 34 int(name) #they actually need to be numbers. #break #Load madlib, and write importer.py that imports it, or import it from shell. import madlib madlib.thank_you("a","fd","234","234234") import madlib #If we import it again, it only runs once. Save shell. #Ask how we can #we can get rid of this annoyance by commenting out the code. But that's not very efficient. #Note that other code we've run has this mystical if __name__ == "__main__" bit.#back to slides. #modify madlib to have an if name block. import madlib #write crappy madlib that doesn't do anything. #use pass, explain pass. from madlib import * from garbage import * thank_you(,,,)#back to slides. name="Name" help(name) help("Name") help(str) help(int) help(float) s.replace() x= s.replace() s.count() s.upper() s.lower() s.len()#back to slides. #First go through all the while loop types. #Then show bad beers and improvements. Run from command line.